// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
import '@/assets/custom_theme/el-theme-cyan.css'
import '@/assets/custom_theme/el-theme-summer.css'
import '@/assets/custom_theme/el-theme-red.css'
import './styles/index.scss'
import './icons'
// import CKEditor from '@ckeditor/ckeditor5-vue'
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'

// import axios from 'axios'
// import VueAxios from 'vue-axios'

import url from '@/api/api'
import "babel-polyfill"
import router from './router'
import store from './store'

Vue.config.productionTip = false
// Vue.config.devtools = false
Vue.use(VueI18n)
// Vue.use(CKEditor)
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
}) //兼容i18n 7.x 版本设置

// Vue.use(VueAxios,axios)
Vue.prototype.SCROLLHEIGHT = 0

Vue.prototype.URL = url

if(process.env.NODE_ENV === 'development'){
  require('./mock.js')
}

require('./assets/css/el-icon.css')

require('./assets/css/font-awesome.css')

const i18n = new VueI18n({
  locale:'zh-CN',//语言标识，通过切换locale的值来实现语言切换，this.$18n.locale
  messages:{
    'zh-CN':Object.assign(
      require('./assets/i18n/cn/common.js'),
      require('./assets/i18n/cn/manage.js'),
      require('./assets/i18n/cn/home'),
      require('./assets/i18n/cn/sys_manage'),
      require('./assets/i18n/cn/pur'),
      require('./assets/i18n/cn/sri'),
      require('./assets/i18n/cn/already_done_task'),
      require('./assets/i18n/cn/need_deal_task'),
      require('./assets/i18n/cn/opr_management'),
      require('./assets/i18n/cn/work_delegate.js'),
      require('./assets/i18n/cn/flow_exp.js'),
      require('./assets/i18n/cn/table_exp.js'),
      require('./assets/i18n/cn/she'),
      require('./assets/i18n/cn/phrase'),
      require('./assets/i18n/cn/dft'),
      zhLocale
    ),
    'en-US':Object.assign(
      require('./assets/i18n/en/common.js'),
      require('./assets/i18n/en/manage.js'),
      require('./assets/i18n/en/home'),
      require('./assets/i18n/en/sys_manage'),
      require('./assets/i18n/en/pur'),
      require('./assets/i18n/en/sri'),
      require('./assets/i18n/en/already_done_task'),
      require('./assets/i18n/en/need_deal_task'),
      require('./assets/i18n/en/work_delegate.js'),
      require('./assets/i18n/en/flow_exp.js'),
      require('./assets/i18n/en/table_exp.js'),
      require('./assets/i18n/en/dft.js'),
      enLocale
    ),
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  store,
  data:{
    COLLAPSE:false,
    NOW_USER:'', //当前用户信息 [pxmwxxx]xxx
  },
  components: { App },
  template: '<App/>'
})
